Helpful Information
 
 
Category: VBS
VBS --> defining the variable every single time

in this line from one of my scripts:

dim ask, a, b, c, b1, b2, r, answer, user

I defined every variable i was useing. Can i leave out all that and just write something like this without the "dim" and the long line of variables?

x = "sgdfgd"
msgbox (x)

If you have "Option Explicit" in the beginning of the script then you have to Dim your variables, otherwise you don't. But it is good practice to always use "Option Explicit" and Dim all the variables, because it can prevent bugs (like reusing a variable name by mistake).

shmoove










privacy (GDPR)